<?php

declare(strict_types=1);

namespace Modules\LessonHour\Models;

use Catch\Traits\DB\BaseOperate;
use Catch\Traits\DB\ScopeTrait;
use Catch\Traits\DB\Trans;
use Illuminate\Database\Eloquent\Model;

/**
 * @property $id
 * @property $customer_id
 * @property $lessons
 * @property $type
 * @property $desc
 * @property $lesson_status
 * @property $remark
 * @property $teacher_id
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
*/
class LessonHour extends Model
{
    use BaseOperate, Trans, ScopeTrait;

    const CREATED_AT = 'created_at'; // 创建时间
    const UPDATED_AT = 'updated_at'; // 更新时间

    public $timestamps = true;
    public $dateFormat = "U";

    protected $table = 'lesson_hour';

    protected $fillable = [ 'id', 'customer_id', 'lessons', 'lesson_type', 'last_lessons', 'desc', 'lesson_status', 'remark', 'teacher_id', 'pay_images', 'reservation_id', 'creator_id', 'created_at', 'updated_at' ];

    /**
     * @var array
     */
    public array $searchable = [

    ];

    public function getCreatedAtAttribute($value)
    {
        return date('Y-m-d H:i:s', strtotime($value));
    }
}
